<?php
/**
 *  学籍异动 - 转学
 */
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\StudentStatusSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

?>
<?= GridView::widget([
    'layout' => "{items}\n{pager}",
    'tableOptions' => ['class' => 'table table-hover table-bordered'],
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn', 'header' => '序号'],

        //'ID',
        'XJBH',
        [
            'attribute' => 'GRID',
            'label' => '姓名',
            'value' => function ($model){ return $model->gR->name; },
        ],
        [
            'attribute' => 'GRID',
            'label' => '性别',
            'value' => function ($model){ return $model->gR->sex; },
        ],
        'XQ',
        'XXMC',
        'ZYMC',
        'XJZT',
        'DJSJ:date',
        'SHZT',

        [
            'class' => 'yii\grid\ActionColumn', 
            'header'=>'操作', 
            'template'=>'{view} {approval} {return}',
            'buttons' => [
                'view' => function ($url, $model, $key) {
                    return Html::a('查看', $url, [
                        'class'=>'btn btn-xs btn-primary',
                        'title'=>'查看学籍',
                    ]);
                },
                'approval' => function ($url, $model, $key) {
                    return Html::a('批准', $url, [
                        'class'=>'btn btn-xs btn-success',
                        'title'=>'批准学籍异动',
                    ]);
                },
                'return' => function ($url, $model, $key) {
                    return Html::a('退回', $url, [
                        'class'=>'btn btn-xs btn-warning',
                        'title'=>'退回学籍异动',
                    ]);
                },
            ]
        ],
    ],
]); ?>

